package com.sws.worktive.job_advance_search;

import android.content.Context;

import com.android.volley.Request.Method;
import com.android.volley.toolbox.JsonObjectRequest;
import com.sws.worktive.job_service.BaseFetcher;
import com.sws.worktive.volley.MyVolley;

public class JobSearchFetcher extends BaseFetcher{
	
	private final String JOB_SEARCH_URL = "http://worktive.com/api/search/index.php/jobs";
	
	public JobSearchFetcher(Context context){
		mContext = context;
	}
	
	public void fetchJobSearch(String requestTag, final JobSearchRequestBody requestBody, JobReceiverListener jobReceiverListener){
		String string = requestBody.toParams(JOB_SEARCH_URL);
		JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(
				Method.GET, 
				string, 
				null, 
				createSuccessListener(jobReceiverListener), 
				createErrorListener(jobReceiverListener));
		MyVolley.getMyVolley(mContext).addToRequestQueue(jsonObjectRequest, requestTag);
	}
	
}
